/**
 * @ author: 汪孟苹
 */
define(["jquery","template",
	"scprit/followup/app/outPatient/outPatient.servers.js",
	"scprit/followup/template/outPatient/outPatient.tpl.js"],
	function($,template,$outPatientServers,tpl){
	var outPatientUi = {};

	var drawTaskBabycard = function(data){
		return template("tpl_outPatient_taskBabycard",data);
	}
	var drawShowContainer = function(data){
		return template("tpl_outPatient_showContainer",data);
	}
	var drawFollowUpTit = function(data){
		return template("tpl_outPatient_followUpTit",data);
	}
	var drawFollowUp = function(data){
		return template("tpl_outPatient_followUp",data);
	}
	var drawPrint = function(data){
		return template("tpl_outPatient_print",data);
	}
	var drawAnchorMenu = function(data){
		return template("tpl_outPatient_anchorMenu",data);
	}
	outPatientUi.taskBabycardInit = function(options){
		$("#"+options.id).html(tpl.init());
		var h = drawTaskBabycard(options.list);
		$("#"+options.id).html(h);
	}
	outPatientUi.showContainerInit = function(options){
		var data = {
			rows: $outPatientServers.handleTasks(options.list,options.taskId)
		};
		$("#"+options.id).html(tpl.init2());
		var h = drawShowContainer(data);
		$("#"+options.id).html(h);
	}
	outPatientUi.FollowUpTitInit = function(options){
		var data = {
			queueName:options.queueName
		}
		$("#"+options.id).html(tpl.init3());
		var html = drawFollowUpTit(data);
		$("#"+options.id).html(html);
	}
	outPatientUi.followUpInit = function(options){
		var data = $outPatientServers.handleFollowupTask(options);
		$("#"+options.id).html(tpl.followupInit());
		var html = drawFollowUp(data);
		$("#"+options.id).html(html);
	}
	outPatientUi.printInit = function(options){
		var data = {
			"info":$outPatientServers.handlePatientInfo(options.info),
			"rows":$outPatientServers.handlePrintQuest(options.data),
			"task":$outPatientServers.handlePrintTask(options.data.task),
			"hospital":options.hospital
		};
		$("#"+options.id).html(tpl.printInit());
		var html = drawPrint(data);
		$("#"+options.id).html(html);
	}
	outPatientUi.anchorMenuInit = function(options){
		var data = {
			"list":$outPatientServers.handleAnchorMenu(options.list)
		};
		$("#"+options.id).html(tpl.anchorMenuInit());
		var html = drawAnchorMenu(data);
		$("#"+options.id).html(html);
	}

	return outPatientUi;
});